package com.zhengke.common.object;

/**
 * *******************************
 * 项目名称：tvmall-parent
 * 文件名称：MyAjaxResult
 * 类说明：  重新定义的一个文件上传的ajax返回结果
 * 创建时间：2020/2/11 15:32
 *
 * @author 王鑫
 * @version 1.0
 * *******************************
 */
public class MyAjaxResult {
    /*public static void main(String[] args) {
        //封装AjaxResult--返回后台数据
        MyAjaxResult.me().setSuccess(true).setMsg("恭喜你操作成功").setObject("你运气好，账号密码都是对的");
    }*/

    public static MyAjaxResult me(){
        return new MyAjaxResult();
    }

    private Boolean success = true;//默认操作成功
    private String msg = "操作成功";//返回前端操作的文字结果

    private Object object;//返回后台的对象

    public Boolean getSuccess() {
        return success;
    }

    public MyAjaxResult setSuccess(Boolean success) {
        this.success = success;
        return this;
    }

    public String getMsg() {
        return msg;
    }

    public MyAjaxResult setMsg(String msg) {
        this.msg = msg;
        return this;
    }

    public Object getObject() {
        return object;
    }

    public MyAjaxResult setObject(Object object) {
        this.object = object;
        return this;
    }

    @Override
    public String toString() {
        return "MyAjaxResult{" +
                "success=" + success +
                ", msg='" + msg + '\'' +
                ", object=" + object +
                '}';
    }
}
